package me.dqn.cloudfeign.controller;

import me.dqn.cloudfeign.service.SayHello;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dqn
 * created at 2018/11/8 - 16:30
 */
@RestController
public class MainController {
    @Autowired
    SayHello sayHello;

    @Value("${server.port}")
    String port;

    @GetMapping("/api-hi/{name}")
    public String hiSomeone(@PathVariable String name) {
        return sayHello.hiToSomeone(name) + " from feign [" + port + "]";
    }
}
